<template>
  <!-- 数据可视化 -->
  <div class="chart-view-container">
    <div class="chart-view" ref="chartView"></div>
  </div>
</template>
    
<script lang="ts" setup>
import * as echarts from "echarts";
import { onMounted, ref } from "vue";

const chartView = ref(null);

onMounted(() => {
  var myChart = echarts.init(chartView.value);
  var option;

  option = {
    xAxis: {
      type: "category",
      data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
      axisTick: {
        show: false,
      },
      splitLine: {
        show: false, // 隐藏分割线
      },
    },
    yAxis: {
      type: "value",
      splitLine: {
        show: false, // 隐藏分割线
      },
    },
    series: [
      {
        data: [150, 230, 224, 218, 135, 147, 260],
        type: "line",
        lineStyle: {
            color: "#466B67",// 线条颜色
            width: 2 // 线条宽度，单位是像素（px）
        },
      },
    ],
  };

  myChart.setOption(option);
});
</script>
    
<style lang="less" scoped>
.chart-view-container {
  width: 95%;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  margin-top: 50px;
  background-color: #232c3d;
  border-radius: 12px;
  .chart-view {
    width: 100%;
    height: 500px;
  }
}
</style>